#pragma once

#ifndef VTTCOMMON_H
#define VTTCOMMON_H

#include "VTTDataTypes.h"

#include <BaseTsd.h>
#include <sys/stat.h>
#include <string>
#include <vector>

#ifdef WIN32
#define VTT_FILE_SEPARATOR "\\"
#else
#define VTT_FILE_SEPARATOR "/"
#endif

bool IsDir( const std::string &strDir );
bool IsFile( const std::string &strFilename );
bool IsValidImageName( const std::string &strImageName );

bool MakeDir( const std::string &strDir );

std::vector<std::string> GetAllImageNamesInsideDir( const std::string &strDir );
std::string GetBasePathOfFile( const std::string &strFilename );
struct tm GetFileChangingDate( const std::string & strFileName );
std::string GetFileExtension( const std::string &strFilename );
std::string GetFileFormatEnding( VTTImageFormat imageFormat );
std::string GetFileNameFromFullPath( const std::string &strFilename );
UINT32 GetNextPowerOfTwo( UINT32 number );
std::string GetStrippedStringAfterChar( const std::string &stringToConsider, const char character, UINT32 startIndex = 0 );
float StdStringToFloat( const std::string &stringToConvert );
UINT32 StdStringToUINT32( const std::string &stringToConvert );
bool StringStartsWith( const std::string &stringToConsider, const std::string &startString );
bool StringEndsWith( const std::string &stringToConsider, const std::string &endString );

int StringToInt( const std::string &stringValue);
std::string UINT32ToString( const UINT32 &uint32Value);
std::string FloatToString( const float &fValue);

void Tokenize( const std::string &str, std::vector<std::string> &tokens,
	const std::string &delimiters = " " );

bool operator ==( const struct tm &time1, const struct tm &time2 );

#endif